<template>
  <el-dialog :title="info.title" :visible.sync="visible" center width="1460px" :before-close="handleCancel">
    <div class="">
      <el-table v-loading="app.loading" ref="multipleTable" class="search-table" :data="list" border fit highlight-current-row style="width: 100%;">
        <el-table-column label="序号" align="center" width="56px">
          <template slot-scope="{$index}">
            {{ $index + 1 }}
          </template>
        </el-table-column>
        <el-table-column label="账户名称" min-width="220px" prop="account_name" />
        <el-table-column label="供应商/公司名称" min-width="220px">
          <template slot-scope="{row}">
            <span v-if="row.sup_name">{{ row.sup_name }}</span>
            <span v-if="row.company">{{ row.company }}</span>
          </template>
        </el-table-column>
        <el-table-column label="项目名称" min-width="260px" prop="pro_name" />
        <el-table-column label="付款金额" align="right" width="140px">
          <template slot-scope="{row}">
            {{ app.toFix(row.money, 2) }}
          </template>
        </el-table-column>
        <el-table-column label="付款日期" align="center" width="140px" prop="sub_time" />
        <el-table-column label="付款类型" width="160px" prop="v_type_name" />
        <el-table-column label="提交人" width="110px" prop="submitter_name" />
        <el-table-column label="备注" min-width="260px" prop="remark" />
        <el-table-column label="申请详情" min-width="260px">
          <template slot-scope="{row}">
            <span v-if="row.pay_time && row.pay_time !== ''">付款时间：{{ row.pay_time }}<br/></span>
            <span v-if="row.use_time && row.use_time !== ''">使用日期：{{ row.use_time }}<br/></span>
            <span v-if="row.return_time && row.return_time !== ''">归还日期：{{ row.return_time }}<br/></span>
            <span v-if="row.word && row.word !== ''">金额大写：{{ row.word }}<br/></span>
            <span v-if="row.addr && row.addr !== ''">使用工地：{{ row.addr }}<br/></span>
            <span v-if="row.detailed && row.detailed !== ''">订单明细：{{ row.detailed }}<br/></span>
            <span v-if="row.stage && row.stage !== ''">期别：{{ row.stage }}<br/></span>
            <span v-if="row.purpose && row.purpose !== ''">用途：{{ row.purpose }}<br/></span>
            <span v-if="row.speed && row.speed !== ''">小包进度：{{ row.speed }}<br/></span>
            <span v-if="row.basis && row.basis !== ''">付款依据：{{ row.basis }}<br/></span>
            <span v-if="row.condition && row.condition !== ''">付款条件：{{ row.condition }}<br/></span>
            <span v-if="row.cycle && row.cycle !== ''">付款周期：{{ row.cycle }}<br/></span>
            <span v-if="row.reason && row.reason !== ''">用途说明：{{ row.reason }}<br/></span>
            <span v-if="row.remark && row.remark !== ''">备注：{{ row.pw_remark }}<br/></span>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="filter.pageAll>0" :total="filter.pageAll" :page.sync="filter.pageCurrent" :limit.sync="filter.pageNumber" @pagination="getList" />
    </div>
  </el-dialog>
</template>

<script>
import page from '@/utils/page'
import { payments } from '@/api/finance/fund'

export default {
  components: { },
  extends: page,
  inject: ['app'],
  props: {
    info: {
      type: Object,
      default: null
    },
    reqList: {
      default: payments,
      type: Function
    }
  },
  data() {
    return {
    }
  },
  watch: {
    visible(val) {
      if (val) {
        this.$set(this, 'form', this.info.edit)
        this.$set(this.filter, 'su_id', this.form.su_id)
        this.getList()
        this.$nextTick(() => {
          this.$refs.multipleTable.doLayout()
        })
      }
    },
    getData: {
      type: Function,
      default: function() {}
    }
  },
  mounted() {
  },
  methods: {
  }
}
</script>

<style scoped>
</style>
